BIN=threads
SRC=$(wildcard *.cc)  
OBJ=$(SRC:.cc=.o)     
CC=g++
FLAGS= -std=c++11

$(BIN):$(OBJ)
	$(CC) -o $@ $^ -lpthread

%.o:%.cc
	$(CC) -c $< $(FLAGS)

.PHONY:clean
clean:
	rm -rf $(BIN) $(OBJ)

.PHONY:test
test:
	@echo "Sources:" $(SRC)
	@echo "Objects:" $(OBJ)
